/**
 * 系统管理 地址配置管理
 */
<template>
  <div>
    <!-- 面包屑导航 -->
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>日志查看</el-breadcrumb-item>
    </el-breadcrumb>
    <!--列表-->
    <el-table
      size="small"
      :data="logData"
      highlight-current-row
      v-loading="loading"
      border
      element-loading-text="拼命加载中"
      style="width: 100%; margin-top: 2%"
    >
      <el-table-column
        align="center"
        prop="description"
        label="方法描述"
        width="100"
      >
      </el-table-column>
      <el-table-column
        align="center"
        prop="time"
        label="执行时间(ms)"
        min-width="100"
      >
      </el-table-column>
      <el-table-column
        align="center"
        prop="logType"
        label="是否执行成功"
        width="100"
      >
      </el-table-column>
       <el-table-column
        align="center"
        prop="createTime"
        label="操作时间"
        width="150"
      >
      </el-table-column>
      <el-table-column
        align="center"
        prop="params"
        label="传入参数"
        width="400"
      >
      </el-table-column>
      <el-table-column
        align="center"
        prop="exceptionDetail"
        label="错误信息"
        width="400"
      >
      </el-table-column>
     
    </el-table>
    <!-- 分页组件 -->
    <Pagination
      v-bind:child-msg="pageparm"
      @callFather="callFather"
    ></Pagination>
  </div>
</template>

<script>
// 导入请求方法
import Pagination from "../../components/Pagination";
import { logList } from "../../api/systemMg";
export default {
  data() {
    return {
      nshow: true, //switch开启
      fshow: false, //switch关闭
      loading: false, //是显示加载
      // 编辑与添加
      // 请求数据参数
      formInline: {
        size: 1,
        current: 10,
      },
      //日志数据
      logData: [],
      pageparm: {
        current: 1,
        size: 10,
        total: 10,
      },
    };
  },
  // 注册组件
  components: {
    Pagination,
  },

  /**
   * 数据发生改变
   */
  watch: {},

  /**
   * 创建完毕
   */
  created() {
    this.formInline.current = 1;
    this.formInline.size = 10;
    let data = {
      pageVo: this.formInline,
    };
    this.getdata(data);
  },

  /**
   * 里面的方法只有被调用才会执行
   */
  methods: {
    // 获取数据方法
    async getdata(parameter) {
      this.loading = true;
      var that = this;
      // 获取用户列表
      await logList(parameter).then((res) => {
        if (res.code == "200") {
          that.loading = false;
          that.logData = res.data.records;
          that.pageparm.current = res.data.current;
          that.pageparm.size = res.data.size;
          that.pageparm.total = res.data.total;
        } else {
          // that.loading = true
          that.configData = [];
        }
      });
    },
    // 分页插件事件
    callFather(parm) {
      this.formInline.page = parm.currentPage;
      this.formInline.limit = parm.pageSize;
      let data = {
        pageVo: this.formInline
      };
      this.getdata(this.formInline);
    },

    //显示编辑界面
    // handleEdit: function (index, row) {
    //   this.editFormVisible = true;
    //   this.editForm = {
    //     id: row.id,
    //     value: row.value,
    //     sortOrder: row.sortOrder,
    //     isShow: row.isShow,
    //   };
    // },
    // 是否显示按钮处理
    // 修改type
    // editType: function () {
    //   this.editForm.isShow == 1
    //     ? (this.editForm.isShow = 0)
    //     : (this.editForm.isShow = 1);
    // },

    // 修改配置处理
    // async submitForm(data) {
    //   let that = this;
    //   // 获取用户列表
    //   await updateConfig(data).then((res) => {
    //     if (res.code == "200") {
    //       that.closeDialog();
    //       this.$message({
    //         type: "success",
    //         message: "电话配置修改成功！",
    //       });
    //       let data = {
    //         pageVo: that.formInline,
    //         keys: ["ADDRESS"],
    //       };
    //       this.getdata(data);
    //     } else {
    //       // that.loading = true
    //       that.configData = [];
    //     }
    //   });
    // },

    // 关闭编辑、增加弹出框
    // closeDialog() {
    //   this.editFormVisible = false;
    // },
  },
};
</script>

<style scoped>
.user-search {
  margin-top: 20px;
}
.userRole {
  width: 100%;
}
</style>

 